return {
  {
    "rmagatti/auto-session",
    lazy = false,
    keys = {
      { 
        ".s", 
        "<CMD>AutoSession restore<CR>", 
        desc = "[Auto Session] Restore session" 
      },
      { 
        ".S",
        "<CMD>AutoSession search<CR>", 
        desc = "[Auto Session] Search session" 
      },
      { 
        ".D", 
        "<CMD>AutoSession delete<CR>", 
        desc = "[Auto Session] Delete session" 
      },
    },

    ---enables autocomplete for opts
    ---@module "auto-session"
    ---@type AutoSession.Config
    opts = {
      auto_restore = false,
      suppressed_dirs = { "~/.local/state/nvim/" },
    },

    init = function()
      vim.o.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions"
    end,
  },
  {
    "okuuva/auto-save.nvim", -- 注意：根据搜索结果，这是当前维护更活跃的分支:cite[5]
    cmd = "ASToggle", -- 可选，用于手动开关自动保存
    event = {"InsertLeave", "TextChanged"}, -- 可选，指定触发事件
    opts = {
      enabled = true, -- start auto-save when the plugin is loaded (i.e. when your package manager loads it)
      trigger_events = { -- See :h events
        immediate_save = { "BufLeave", "FocusLost", "QuitPre", "VimSuspend" }, -- vim events that trigger an immediate save
        defer_save = { "InsertLeave", "TextChanged" }, -- vim events that trigger a deferred save (saves after `debounce_delay`)
        cancel_deferred_save = { "InsertEnter" }, -- vim events that cancel a pending deferred save
      },
      -- function that takes the buffer handle and determines whether to save the current buffer or not
      -- return true: if buffer is ok to be saved
      -- return false: if it's not ok to be saved
      -- if set to `nil` then no specific condition is applied
      condition = function(buf)
        local fn = vim.fn
        local utils = require("auto-save.utils.data")
        if fn.getbufvar(buf, "&modifiable") == 1 then
          return true -- 文件可修改，允许保存
        end
        return false
      end,
      write_all_buffers = false, -- write all buffers when the current one meets `condition`
      noautocmd = false, -- do not execute autocmds when saving
      lockmarks = false, -- lock marks when saving, see `:h lockmarks` for more details
      debounce_delay = 1000, -- delay after which a pending save is executed
      -- log debug messages to 'auto-save.log' file in neovim cache directory, set to `true` to enable
      debug = false,
    },
  },
  {
    "mtth/scratch.vim", 
    config = function()
      vim.g.scratchDefaultFiletype = 'markdown' -- 设置scratch缓冲区的默认文件类型
      vim.g.scratchFIT = 1 -- 启用插件
    end,
    keys = {
      { "<leader>s", "<cmd>Scratch<CR>", desc = "Open Scratch Buffer" }
    },
    cmd = "Scratch" -- 当执行:Scratch命令时加载插件 :cite[2]
  },
  {
    "lilydjwg/fcitx.vim",
    -- 可选：配置事件触发懒加载，以优化启动性能
    event = { "InsertEnter", "InsertLeave" },
    -- 如果你的 fcitx 版本是 fcitx5，可能还需要设置环境变量
    -- 可以在 config 函数中设置，或者在你的 shell 配置文件（如 .bashrc 或 .zshrc）中设置
    config = function()
      -- 例如，设置 fcitx 套接字环境变量（如果需要）
      -- vim.fn.setenv("FCITX_SOCKET", "@fcitx-socket")
    end,
  },
}


